package com.litengsoft.lianmeng.common;

/**
 * Created by zoushaofei on 17-04-10.
 */
public class PageBean {

    /**
     * 当前页数
     */
    private int pageNum = 1;

    /**
     * 每页条数
     */
    private int pageSize = 10;

    /**
     * 总页数
     */
    private long totalPage;

    /**
     * 总条数
     */
    private long totalCount;
    /**
     * 分页起始记录游标
     */
    private long startRow;

    public PageBean(){}

    public PageBean(int page) {
        this.pageNum = page;
    }

    public PageBean(int page, int size) {
        this.pageNum = page;
        this.pageSize = size;
    }

    public long getStartRow() {
        this.startRow = (pageNum - 1)*pageSize;
        return startRow;
    }

    public int getPageNum() {
        return pageNum;
    }

    public void setPageNum(int pageNum) {
        if (pageNum <= 0) {
            this.pageNum = 1;
        } else {
            this.pageNum = pageNum;
        }
    }

    public int getPageSize() {
        return pageSize;
    }

    public void setPageSize(int pageSize) {
        if (pageSize <= 0) {
            this.pageSize = 10;
        } else {
            this.pageSize = pageSize;
        }
    }

    public long getTotalPage() {
        return totalPage;
    }

    public void setTotalPage(long totalPage) {
        this.totalPage = totalPage;
    }

    public long getTotalCount() {
        return totalCount;
    }

    public void setTotalCount(long totalCount) {
        this.totalCount = totalCount;
    }
}
